package com.lvyq.myplayer.model.current

import androidx.lifecycle.ViewModel
import com.lvyq.myplayer.dao.CurrentPlayLstDao
import kotlinx.coroutines.flow.Flow
/**
 * 文件描述：PlayCacheViewModel
 * 作者：lvyq
 * 创建时间：2025-06-16
 * 修改时间：2025-06-16
 */
class CurrentPlayLstViewModel(private val currentPlayLstDao: CurrentPlayLstDao) : ViewModel() {

     fun getAllCurrentPlayLstFlow():Flow<List<CurrentPlayLstEntity> >{
       return currentPlayLstDao.getAllCurrentPlayLstFlow()
    }
    //协程
    suspend  fun getAllCurrentPlayLst():List<CurrentPlayLstEntity>{
        return currentPlayLstDao.getAllCurrentPlayLst()
    }
     suspend fun insertCurrentPlayLst(data: CurrentPlayLstEntity) {
         currentPlayLstDao.insertCurrentPlayLst(data)
     }


    suspend fun deleteByIds(ids: List<Int>) {
        currentPlayLstDao.deleteByIds(ids)
    }

    suspend fun deleteById(id: Int){
        currentPlayLstDao.deleteById(id)
    }




}
